package com.srwl.mytx.domain;


import android.os.Parcel;
import android.os.Parcelable;

import com.srwl.mytx.domain.User;

import java.util.List;

/**
 * Created by wei on 2016/5/27.
 */
public class LiveRoom implements Parcelable {

    private String id;
    private String managerId;
    private String anchorId;
    private String rId;//当前直播间绑定的直播记录id
    private String aId;//直播间当前可以出价的广告位id

    //星盒直播间id，因为创建星盒直播间没法指定id,需要在审核通过的时候，创建一个直播间保存到服务端和更新进缓存
    private String liveId;

    private String title;
    private Integer audienceSize;//观众人数
    private String video;
    private String cover;
    private String chatId;
    private String subTitle;
    private Integer status;
    private Integer type;
    private Topic goods;
    private User anchor;
    private LiveRecord liveRecord;
    private Advertisement advertisement;//直播间当前展示的广告位信息
    private List<Coupon> coupons;//发到直播间的红包
    private Coupon coupon;
    private List<String>memberIdList;

    public LiveRoom(String id, String managerId, String anchorId, String rId, String aId, String title, Integer audienceSize, String cover, String chatId, String subTitle, Integer status, Integer type, Topic goods, User anchor, LiveRecord liveRecord, Advertisement advertisement, List<Coupon> coupons) {
        this.id = id;
        this.managerId = managerId;
        this.anchorId = anchorId;
        this.rId = rId;
        this.aId = aId;
        this.title = title;
        this.audienceSize = audienceSize;
        this.cover = cover;
        this.chatId = chatId;
        this.subTitle = subTitle;
        this.status = status;
        this.type = type;
        this.goods = goods;
        this.anchor = anchor;
        this.liveRecord = liveRecord;
        this.advertisement = advertisement;
        this.coupons = coupons;
    }

    public Topic getGoods() {
        return goods;
    }

    public void setGoods(Topic goods) {
        this.goods = goods;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public User getAnchor() {
        return anchor;
    }

    public void setAnchor(User anchor) {
        this.anchor = anchor;
    }

    public String getrId() {
        return rId;
    }

    public void setrId(String rId) {
        this.rId = rId;
    }

    public String getaId() {
        return aId;
    }

    public void setaId(String aId) {
        this.aId = aId;
    }

    public String getLiveId() {
        return liveId;
    }

    public void setLiveId(String liveId) {
        this.liveId = liveId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getAudienceSize() {
        return audienceSize;
    }

    public void setAudienceSize(int audienceSize) {
        this.audienceSize = audienceSize;
    }

    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getChatId() {
        return chatId;
    }

    public void setChatId(String chatId) {
        this.chatId = chatId;
    }


    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    public String getSubTitle() {
        return subTitle;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public LiveRecord getLiveRecord() {
        return liveRecord;
    }

    public void setLiveRecord(LiveRecord liveRecord) {
        this.liveRecord = liveRecord;
    }

    public Advertisement getAdvertisement() {
        return advertisement;
    }

    public void setAdvertisement(Advertisement advertisement) {
        this.advertisement = advertisement;
    }

    public String getManagerId() {
        return managerId;
    }

    public void setManagerId(String managerId) {
        this.managerId = managerId;
    }

    public String getanchorId() {
        return anchorId;
    }

    public void setanchorId(String anchorId) {
        this.anchorId = anchorId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public List<Coupon> getCoupons() {
        return coupons;
    }

    public void setCoupons(List<Coupon> coupons) {
        this.coupons = coupons;
    }

    public Coupon getCoupon() {
        return coupon;
    }

    public void setCoupon(Coupon coupon) {
        this.coupon = coupon;
    }

    public List<String> getMemberIdList() {
        return memberIdList;
    }

    public void setMemberIdList(List<String> memberIdList) {
        this.memberIdList = memberIdList;
    }

    public LiveRoom() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.managerId);
        dest.writeString(this.anchorId);
        dest.writeString(this.rId);
        dest.writeString(this.aId);
        dest.writeString(this.liveId);
        dest.writeString(this.title);
        dest.writeValue(this.audienceSize);
        dest.writeString(this.video);
        dest.writeString(this.cover);
        dest.writeString(this.chatId);
        dest.writeString(this.subTitle);
        dest.writeValue(this.status);
        dest.writeValue(this.type);
        dest.writeParcelable(this.goods, flags);
        dest.writeParcelable(this.anchor, flags);
        dest.writeParcelable(this.liveRecord, flags);
        dest.writeParcelable(this.advertisement, flags);
        dest.writeTypedList(this.coupons);
        dest.writeParcelable(this.coupon, flags);
        dest.writeStringList(this.memberIdList);
    }

    protected LiveRoom(Parcel in) {
        this.id = in.readString();
        this.managerId = in.readString();
        this.anchorId = in.readString();
        this.rId = in.readString();
        this.aId = in.readString();
        this.liveId = in.readString();
        this.title = in.readString();
        this.audienceSize = (Integer) in.readValue(Integer.class.getClassLoader());
        this.video = in.readString();
        this.cover = in.readString();
        this.chatId = in.readString();
        this.subTitle = in.readString();
        this.status = (Integer) in.readValue(Integer.class.getClassLoader());
        this.type = (Integer) in.readValue(Integer.class.getClassLoader());
        this.goods = in.readParcelable(Topic.class.getClassLoader());
        this.anchor = in.readParcelable(User.class.getClassLoader());
        this.liveRecord = in.readParcelable(LiveRecord.class.getClassLoader());
        this.advertisement = in.readParcelable(Advertisement.class.getClassLoader());
        this.coupons = in.createTypedArrayList(Coupon.CREATOR);
        this.coupon = in.readParcelable(Coupon.class.getClassLoader());
        this.memberIdList = in.createStringArrayList();
    }

    public static final Creator<LiveRoom> CREATOR = new Creator<LiveRoom>() {
        @Override
        public LiveRoom createFromParcel(Parcel source) {
            return new LiveRoom(source);
        }

        @Override
        public LiveRoom[] newArray(int size) {
            return new LiveRoom[size];
        }
    };
}
